<?php

namespace App\Traits;

trait ModelTrait
{
    /**
     * 处理空集
     * @param $collection
     * @return array|mixed
     */
    public static function resultEmptyDeal($collection)
    {
        if ($collection->isEmpty()) {
            return [];
        }
        return $collection->toArray();
    }
}
